/******************************************************************
 * Created by: DO HOANG HAI                                       
 * Date of Creation:
 * Date of last modification: 1st/Sep/2007
 *                                                                
 * Description: Contain data of a search request
 * 
 * Status: Opimized & Finished
 ******************************************************************/
using System;
using System.Collections.Generic;
using System.Collections;
using Pbdms.Common.DataObject;
using System.Text;

namespace Pbdms.Common.DataObject
{
    /// <summary>
    /// A search object is a data object keeping information of sarch criteria.
    /// </summary>
    [System.Xml.Serialization.XmlInclude(typeof(Common.DataObject.BibTexStruct))]
    public class SearchObj
    {
        /// <summary>
        /// indicate that the search source is the local database
        /// </summary>
        public const int SOURCE_LOCAL_ONLY = 0;
        /// <summary>
        /// indicate that the search source is from the network only
        /// </summary>
        public const int SOURCE_NETWORK_ONLY = 1;
        /// <summary>
        /// indicate that the search source is from both local database and from the network
        /// </summary>
        public const int SOURCE_LOCAL_AND_NETWORK = 2;

        #region "private attributes"

        private ArrayList bibTexesStruct = null;
        private int searchSource = 0;
        private bool hasComment = true;
        private double minRating = 0.0;
        private bool hasFile = true;
        private ArrayList tags = null;
        private string category = "All";
        private long minFileSize = 0;
        private long maxFileSize = 100000000;

        #endregion

        #region "public properties"

        public ArrayList BibTexesStruct
        {
            get { return bibTexesStruct; }
            set { bibTexesStruct = value; }
        }
        
        public int SearchSource
        {
            get { return searchSource; }
            set { searchSource = value; }
        }
       
        public bool HasComment
        {
            get { return hasComment; }
            set { hasComment = value; }
        }
       
        public double MinRating
        {
            get { return minRating; }
            set { minRating = value; }
        }
  
        public bool HasFile
        {
            get { return hasFile; }
            set { hasFile = value; }
        }
        
        public ArrayList Tags
        {
            get { return tags; }
            set { tags = value; }
        }
        
        public string Category
        {
            get { return category; }
            set { category = value; }
        }
        
        public long MinFileSize
        {
            get { return minFileSize; }
            set { minFileSize = value; }
        }
        
        public long MaxFileSize
        {
            get { return maxFileSize; }
            set { maxFileSize = value; }
        }

        #endregion

        public SearchObj() 
        { 
        }

        public SearchObj(int searchSource, bool hasComment, double minRating, bool hasFile, ArrayList tags,
            string category, long minFileSize, long maxFileSize, ArrayList bibTexesStruct)
        {
            this.searchSource = searchSource;
            this.hasComment = hasComment;
            this.minRating = minRating;
            this.hasFile = hasFile;
            this.tags = tags;
            this.category = category;
            this.minFileSize = minFileSize;
            this.maxFileSize = maxFileSize;
            this.bibTexesStruct = bibTexesStruct;

        }


    }
}
